<div class="hero-unit">
    <h1>Welcome!</h1>

    <p>
        Board On Grails è uno strumento messo a disposizione agli studenti della SUPSI per fare domande
        inerenti a materie specifiche, come per esempio, domande di matematica, sviluppo software, ecc...
    </p>
</div>

<div id="threads-list">
    <h2>Argomenti aperti</h2>
    <span class="label label-info">Ci sono ${openedThreads.size()} thread aperti</span>
    <div class="department-threads-container">
        <div class="threads-header">
            <g:each var="thread" in="${openedThreads}">
            <h3><g:link action="show/${thread.id}" controller="thread">${thread.question?.title}</g:link></h3>
            <p>
                <pre>${thread.question?.content}</pre>
            </p>
            </g:each>
        </div>
    </div>

<br />

    <h2>Argomenti risolti</h2>
    <p>
    <span class="label label-success">Ci sono ${solvedThreads.size()} thread risolti</span>

    <div class="threads-header">
        <g:each var="thread" in="${solvedThreads}">
        <h3><g:link action="show/${thread.id}" controller="thread">${thread.question?.title}</g:link></h3>
        <p>
            <pre>${thread.question?.content}</pre>
            %{--<h5>Best answer</h5>--}%
            %{--<div class="alert alert-success">--}%
                %{--${thread.bestAnswer.content.decodeHTML()}--}%
            %{--</div>--}%
        </p>
        </g:each>
    </div>

<br />

<h2>Argomenti chiusi</h2>
<p>
    <span class="label label-important">Ci sono ${closedThreads.size()} thread chiusi</span>

<div class="threads-header">
    <g:each var="thread" in="${closedThreads}">
    <h3><g:link action="show/${thread.id}" controller="thread">${thread.question?.title}</g:link></h3>
    <p>
    <pre>${thread.question?.content}</pre>
    </p>
        </g:each>
    </div>


</div>